package hu.jonas.time.client.model;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Task implements Serializable {

	private static final long serialVersionUID = 6387315717965443266L;

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
	private String encodedKey;
	
	@Persistent
	@Extension(vendorName = "datanucleus", key = "gae.pk-id", value = "true")
	private Long keyId;
	
	@Persistent
	private String name;
	
	@Persistent
	private String description;
	
	@Persistent
	private int priority;
	
	@Persistent
	private Date dueDate;
	
	@Persistent
	private Date startDate;
	
	@Persistent
	private double completionRate;
	
	@Persistent
	private Set<Task> preConditions;
	
	public Task() {
	}
	
	public String getEncodedKey() {
		return encodedKey;
	}

	public Long getKeyId() {
		return keyId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getPriority() {
		return priority;
	}

	public void setPriority(int priority) {
		this.priority = priority;
	}

	public Date getDueDate() {
		return dueDate;
	}

	public void setDueDate(Date dueDate) {
		this.dueDate = dueDate;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public double getCompletionRate() {
		return completionRate;
	}

	public void setCompletionRate(double completionRate) {
		this.completionRate = completionRate;
	}

	public Set<Task> getPreConditions() {
		return preConditions;
	}

	public void setPreConditions(Set<Task> preConditions) {
		this.preConditions = preConditions;
	}
	
}
